/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cl.bussines.entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Vogel
 */
@Entity
@Table(name = "valor_hora")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ValorHora.findAll", query = "SELECT v FROM ValorHora v"),
    @NamedQuery(name = "ValorHora.findByIdValorHora", query = "SELECT v FROM ValorHora v WHERE v.idValorHora = :idValorHora"),
    @NamedQuery(name = "ValorHora.findByValorHora", query = "SELECT v FROM ValorHora v WHERE v.valorHora = :valorHora"),
    @NamedQuery(name = "ValorHora.findByFecha", query = "SELECT v FROM ValorHora v WHERE v.fecha = :fecha"),
    @NamedQuery(name = "ValorHora.findByRutEmpleado", query = "SELECT v FROM ValorHora v WHERE v.rutEmpleado = :rutEmpleado")})
public class ValorHora implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "Estado")
    private int estado;
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_Valor_Hora")
    private Integer idValorHora;
    @Size(max = 11)
    @Column(name = "Valor_Hora")
    private String valorHora;
    @Column(name = "Fecha")
    @Temporal(TemporalType.DATE)
    private Date fecha;
    @Basic(optional = false)
    @NotNull
    @Column(name = "Rut_Empleado")
    private int rutEmpleado;

    public ValorHora() {
    }

    public ValorHora(Integer idValorHora) {
        this.idValorHora = idValorHora;
    }

    public ValorHora(Integer idValorHora, int rutEmpleado) {
        this.idValorHora = idValorHora;
        this.rutEmpleado = rutEmpleado;
    }

    public Integer getIdValorHora() {
        return idValorHora;
    }

    public void setIdValorHora(Integer idValorHora) {
        this.idValorHora = idValorHora;
    }

    public String getValorHora() {
        return valorHora;
    }

    public void setValorHora(String valorHora) {
        this.valorHora = valorHora;
    }

    public Date getFecha() {
        return fecha;
    }

    public void setFecha(Date fecha) {
        this.fecha = fecha;
    }

    public int getRutEmpleado() {
        return rutEmpleado;
    }

    public void setRutEmpleado(int rutEmpleado) {
        this.rutEmpleado = rutEmpleado;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idValorHora != null ? idValorHora.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ValorHora)) {
            return false;
        }
        ValorHora other = (ValorHora) object;
        if ((this.idValorHora == null && other.idValorHora != null) || (this.idValorHora != null && !this.idValorHora.equals(other.idValorHora))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "cl.bussines.entities.ValorHora[ idValorHora=" + idValorHora + " ]";
    }

    public int getEstado() {
        return estado;
    }

    public void setEstado(int estado) {
        this.estado = estado;
    }
    
}
